﻿<%@ Page Language="C#" MasterPageFile="~/Admin.master" Theme="Admin" AutoEventWireup="true"
    CodeFile="AManageShipment.aspx.cs" Inherits="Pages_AManageShipment" Title="Untitled Page" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="PageStyle">
        <div class="Content">
            <div class="HeaderStyle">
                <span class="Title1">Shipment's managent</span>
                <div class="HeadLine">
                </div>
            </div>
            <div class="FormStyle">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 60px">
                            Ngày tạo
                        </td>
                        <td class="c1empty">
                        </td>
                        <td>
                            <asp:TextBox ID="txtStart" runat="server"></asp:TextBox>
                            <input type="button" id="btStart" value="..." class="Browse" />
                            <cc1:CalendarExtender ID="calStart" PopupButtonID="btStart" TargetControlID="txtStart"
                                runat="server">
                            </cc1:CalendarExtender>
                        </td>
                        <td align="center" style="width: 60px">
                            <img alt="goto" width="24" src="../App_Themes/Admin/img/arrowright.png" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtEnd" runat="server"></asp:TextBox>
                            <input id="btEnd" type="button" value="..." class="Browse" />
                            <cc1:CalendarExtender ID="calEnd" PopupButtonID="btEnd" TargetControlID="txtEnd"
                                runat="server">
                            </cc1:CalendarExtender>
                        </td>
                    </tr>
                    <tr class="r1empty">
                        <td colspan="5">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="5" class="ButtonStyle">
                            <asp:Button ID="btFilter" Text="Filter" runat="server" OnClick="btFilter_Click" />
                        </td>
                    </tr>
                </table>
                <div class="r1empty">
                </div>
                <asp:GridView ID="gv" GridLines="None" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="OrID" CellPadding="0" AllowPaging="True" CssClass="GridStyle"
                    AllowSorting="True" DataSourceID="odsCate">
                    <Columns>
                        <asp:TemplateField HeaderText="Đơn h&#224;ng">
                            <ItemTemplate>
                                <%# Eval("OrID")%>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Họ & tên">
                            <ItemTemplate>
                                <%# Eval("HoTen") %>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Điện thoại">
                            <ItemTemplate>
                                <%# Eval("SoLienLac")%>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Bắt đầu">
                            <ItemTemplate>
                                <%# (DateTime.Parse(Eval("BatDau").ToString())).ToString("dd/MM/yyyy") %>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Vận chuyển">
                            <ItemTemplate>
                                <%# int.Parse(Eval("PhiVanChuyen").ToString()).ToString("$#,#", myInfo)%>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Trang th&#225;i">
                            <ItemTemplate>
                                <%# Eval("TrangThai") %>
                            </ItemTemplate>
                            <ItemStyle CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a href='<%# "AViewShipment.aspx?oid="+ Eval("OrID").ToString() %>' target="iViewCart"
                                    onclick='javascript:$("#myviewer").Popup("show");'>Detail</a>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" CssClass="RowCell" />
                            <HeaderStyle CssClass="HeaderCell" Width="100px" />
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="GridRow" />
                    <AlternatingRowStyle CssClass="GridAltRow" />
                    <HeaderStyle CssClass="GridHeader" />
                    <FooterStyle CssClass="GridFooter" />
                    <PagerStyle CssClass="GridPager" />
                </asp:GridView>
                <asp:ObjectDataSource ID="odsCate" runat="server" SelectMethod="getShipments" TypeName="Jewelry.BussinessLayer.ShipmentBLL"
                    OnObjectCreating="odsCreating" OnSelected="odsSelected" OnSelecting="odsSelecting">
                    <SelectParameters>
                        <asp:Parameter Name="start" Type="DateTime" />
                        <asp:Parameter Name="end" Type="DateTime" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:CustomValidator ID="cval" runat="server" ValidationGroup="cate" Display="Dynamic"></asp:CustomValidator>
                <div class="r1empty">
                </div>
            </div>
            <div class="FooterStyle">
            </div>
        </div>
        <div id="myviewer">
            <iframe frameborder="0" scrolling="no" marginheight="0" width="350" height="330"
                marginwidth="0" name="iViewCart"></iframe>
        </div>
    </div>

    <script type="text/javascript">
        $(document).ready(function ()
        {
            $("#myviewer").Popup({
                classCloseBT: 'closeBt',
                imageCloseBT: '../App_Themes/Admin/img/Close.png'
            });
        });
        
    </script>

</asp:Content>
